using DataScripter.Excel.Table;

namespace DataScripter.Excel.Formulas
{
	internal class Lookup2Ref : Formula
	{
		private readonly Reference _referredCell;

		public Lookup2Ref(int value, TableColumn column)
		{
			_referredCell = column.Table.LookupReference(value, column);
		}

		public Lookup2Ref(string value, TableColumn column)
		{
			_referredCell = column.Table.LookupReference(value, column);
		}

		#region Overrides of Formula

		public override string Resolve(ICell current)
		{
			return _referredCell.Resolve(current);
		}

		#endregion
	}
}